package com.xl.web.service.zoom;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.xl.base.annotation.DataSource;
import com.xl.core.enums.SourceEnum;
import com.xl.core.util.zoom.ZoomRestAPI;
import com.xl.web.dao.zoom.InitParamDao;

/**
 * 初始化公司信息，主要保存密钥信息
 * @author Administrator
 *
 */
@Service(value = "initParam")
public class InitParam<T extends Object> {
	protected static Logger logger = Logger.getLogger(InitParam.class);
	@Resource
	private  InitParamDao<Map> initParamDao;
	public  static Map<String,Object> companysMap = new HashMap<String,Object>();;
	@DataSource(source = SourceEnum.TYPE_SLAVE)
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public  void queryCompany(){
		  List<Map> companys = initParamDao.queryCompany();
		  //加载数据的时间戳当数据超过一天重新加载
		  companysMap.put("loadTime", System.currentTimeMillis());
		  companysMap.put("companys", companys);
	}
}
